package com.zhku.yygh.cmn.client;

import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Repository;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * @BelongsProject: yygh-parent
 * @BelongsPackage: com.zhku.yygh.cmn.client
 * @Author: "deweyMDH"
 * @CreateTime: 2023-05-16  12:32
 * @Version: 1.0
 */
@FeignClient(value = "service-cmn", path = "/admin/cmn/dict")
@Repository
public interface DictFeignClient {

    // 根据dictCode 和value 查询
    @ApiOperation(value = "获取数据字典名称")
    @GetMapping(value = "/getName/{dictCode}/{value}")
    public String getName(@PathVariable("dictCode") String dictCode,
                          @PathVariable("value") String value);

    // 根据 value 查 （如果可以直接根据value查就，直接根据valu查，否则就要麻烦点去，先查dictCode）
    @ApiOperation(value = "获取数据字典名称")
    @GetMapping(value = "/getName/{dictCode}/{value}")
    public String getName(@PathVariable("value") String value);
}
